<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@ page import="com.yls.except.util.GeneralResult" %>
<%@ page import="org.json.JSONArray" %>
<%@ page import="com.yls.except.util.StringIsempty" %>
<%@ page import="org.json.JSONObject" %>

<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<!DOCTYPE HTML>
<html>
<head>
    <base href="<%=basePath%>">
    <title>确认订单</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>

    <!-- 加载Css 样式 -->
    <link href="css/ConfirmOrder_Css.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript" src="js/jquery-1.11.3.min.js"></script>
    <script type="text/javascript" src="js/public.js"></script>
    <script type="text/javascript" src="js/indent/pre_order.js"></script>
    <script>
        function showPopup() {
            if($(".cqchoosenum").hasClass("pop_payss")) {
                $(".cqchoosenum").removeClass("pop_payss");
                $("#background").hide();
            } else {
                $(".cqchoosenum").addClass("pop_payss");
                $("#background").show();
            }
        }

        function back() {
            window.history.back(-1);
        }
    </script>
</head>

<body style="background-color: #F2F2F2;">

<!-- 固定的title 样式 -->
<%--<header class="header">--%>
    <%--<div align="left" class="a">--%>
        <%--<img src="img/arrow_eft_circle.png" style="padding: 10px;height: 28px; width: 28px;" onclick="back()" />--%>
    <%--</div>--%>

    <%--<div align="center" class="a">--%>
        <%--<span style="padding: 15px;font-size: 20px;color: white;">确认订单</span>--%>
    <%--</div>--%>

    <%--<div align="right" class="a">--%>
        <%--<img src="img/more.png" style="padding: 10px;height: 28px;width: 28px;" />--%>
    <%--</div>--%>
<%--</header>--%>

<div class="delivery_method" id="delivery_method">
    <span class="span_one">配送方式</span>
    <input class="radio_type" type="radio" value="0" checked="checked"/> <span class="span_two">订单配送</span>
    <input class="radio_type" type="radio" value="1"/> <span class="span_two">商品仓储</span>
</div>

<!-- 自定以  hr -->
<hr style="height: 1px; width: 97%; float: right; background-color: #f4f4f4; border: none;" />

<!-- 仓储信息 -->
<div class="clearboth" style="background-color: white;" id="delivery_desc">

    <div style="float: left;padding: 10px;">
        <span style="font-size: 15px;color: #6d6d6d;">仓储功能</span>
    </div>

    <div style="float: left; width: 60%;padding: 10px;">
        <span>参数B参数B参数B参数B参数B参数B参数B参数B参数B参数B参数B参数B参数B参数B参数B参数B参数B参数B</span>
    </div>
</div>
<!-- 10px过度线 -->
<div class="clearboth" style="border: solid #f4f4f4 5px;">
</div>

<!-- 加载地址 -->
<div>
    <div class="show_address">
        <div class="left">
            <img class="img_size" src="img/consignee.png" />
            <span class="username">夏天</span>
        </div>
        <div class="right">
            <img class="img_size" src="img/cellphone.png" />
            <span class="phone"><i>15178889347</i></span>
        </div>
    </div>

    <div class="show_address_out">
        <div class="address_div">
            <img class="img_size" src="img/address.png" />
        </div>
        <div style="width: 85%;float: left;margin-bottom: 15px;">
            <span class="address">浙江省杭州市西湖区转塘街道。浙江省杭州市西湖区转塘街道。浙江省杭州市西湖区转塘街道。</span>
        </div>
    </div>
</div>

<div style="height: 3px;">
    <img src="img/Addsplit.png" class="address_hr" />
</div>

<!-- 实现订单列表 -->

<%
    String shopinfo = request.getParameter("shopinfo");
    if(!StringIsempty.isallempty(shopinfo)){
        Map<String, Object> map = GeneralResult.jsonStrToMap(shopinfo);
        JSONArray shop = (JSONArray) map.get("shopinfo");
        if(shop != null && shop.length() > 0) {
            for(int i = 0; i < shop.length(); i ++) {
                JSONObject jsonobject = shop.getJSONObject(i);
%>

<div class="store_name">
    <div style="float: left;">
        <img src="img/logo_icon.png" class="add_img" />
        <span>摘记良品</span>
    </div>
    <!--<div style="float: right;">
        <img src="img/right.png" class="right_img" />
    </div>-->
</div>
<!-- 自定以  hr -->
<hr style="height: 1px; width: 100%; background-color: #f4f4f4; border: none;" />

<!-- 商品详情 -->
<div class="goods">
    <input type="hidden" value="<%=jsonobject.get("shopid")%>"/>
    <input type="hidden" value="<%=jsonobject.get("age")%>"/>
    <input type="hidden" value="<%=jsonobject.get("sex")%>"/>
    <input type="hidden" value="<%=jsonobject.get("shopspecid")%>"/>
    <img src="<%=jsonobject.get("img")%>" class="item_img" onerror="imgerror(this,'img/onerror.png');"/>
    <ul class="item_ul">
        <li><span class="item_name"><%=jsonobject.get("shopname")%></span></li>
        <li>
            <div style="margin-top: 10px;">
                <span class="item_desc"><%=jsonobject.get("specname")%></span>
                <span class="item_buy_num">X<%=jsonobject.get("num")%></span>
            </div>
        </li>
        <li><span class="item_money">￥:<%=jsonobject.get("price")%></span></li>
    </ul>
</div>
<!-- 自定以  hr -->
<hr style="height: 1px; width: 97%; float: right; background-color: #f4f4f4; border: none;" />
<%
            }
        }
    }

%>
<!-- 运费 -->
<div class="trans_div">
    <span class="tran_span">运费</span>
    <span class="tran_money">￥<i>10.00</i></span>
</div>
<!-- 自定以  hr -->
<hr style="height: 1px; width: 97%; float: right; background-color: #f4f4f4; border: none;" />

<div class="trans_div_bttom">
    <span class="span_all_money">￥109.00</span>
    <span class="span_all_money">小计</span>
</div>

<!-- 底部数据统计 -->
<div class="bottom">
    <div class="left">
        <span>合计:</span>
        <span class="left_span">￥<i>109.00</i></span>
    </div>
    <div class="right">
        <span class="right_span" onclick="showPopup()">立即支付</span>
    </div>
</div>

<!-- 加载弹窗支付信息布局 -->

<!-- 这里需要把两个布局格式区分出来
      他本来就不属于在文档流中，position:fixed;或使他脱离文档流
     区分出来让他两个独立加载。
 -->
<div id="background" style="background: rgba(0,0,0,0.5);height: 100%;width: 100%;position: fixed;top: 0;display: none;"></div>
<div class="cqchoosenum">
    <div class="pop_pay">
        <div class="pop_title">
            <div class="pop_cancel">
                <img src="img/cancel.png" onclick="showPopup()" />
            </div>
            <div class="title">支付信息</div>
        </div>
        <hr style="height: 1px; width: 100%; float: right; background-color: #f4f4f4; border: none;" />
        <div class="clearboth"></div>
        <div class="pay_style">
            <span class="span_one">支付方式</span>
            <input class="radio_type" type="radio" /> <span class="span_two">余额(￥200.00)</span>
            <input class="radio_type" type="radio" /> <span class="span_two">微信支付</span>
        </div>
        <hr style="height: 1px; width: 97%; float: right; background-color: #f4f4f4; border: none;" />
        <div class="pay_money_div">
            <span style="font-size: 16px;">应付金额</span>
            <span class="pay_money">￥:109.00</span>
        </div>
        <!-- 确认支付 -->
        <div id="buy" class="buy_bg">
            <span style="width: 90%;font-size: 16px;color: white;">确认支付</span>
        </div>
    </div>
</div>
</body>
</html>